<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理后台 - 报单系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-icons/1.7.2/font/bootstrap-icons.min.css" rel="stylesheet">
    <style>
        body {
            font-size: .875rem;
        }
        
        .sidebar {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            z-index: 100;
            padding: 48px 0 0;
            box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
        }
        
        .sidebar-sticky {
            position: relative;
            top: 0;
            height: calc(100vh - 48px);
            padding-top: .5rem;
            overflow-x: hidden;
            overflow-y: auto;
        }
        
        .sidebar .nav-link {
            font-weight: 500;
            color: #333;
            padding: .75rem 1rem;
            border-radius: 0;
        }
        
        .sidebar .nav-link:hover {
            background-color: rgba(0, 0, 0, .05);
        }
        
        .sidebar .nav-link.active {
            color: #007bff;
            background-color: rgba(0, 123, 255, .1);
        }
        
        .navbar-brand {
            padding-top: .75rem;
            padding-bottom: .75rem;
            font-size: 1rem;
            background-color: rgba(0, 0, 0, .25);
            box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
        }
        
        .navbar .navbar-toggler {
            top: .25rem;
            right: 1rem;
        }
        
        .navbar .form-control {
            padding: .75rem 1rem;
            border-width: 0;
            border-radius: 0;
        }
        
        .form-control-dark {
            color: #fff;
            background-color: rgba(255, 255, 255, .1);
            border-color: rgba(255, 255, 255, .1);
        }
        
        .form-control-dark:focus {
            border-color: transparent;
            box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
        }
        
        .border-left-primary {
            border-left: .25rem solid #4e73df !important;
        }
        
        .border-left-success {
            border-left: .25rem solid #1cc88a !important;
        }
        
        .border-left-info {
            border-left: .25rem solid #36b9cc !important;
        }
        
        .border-left-warning {
            border-left: .25rem solid #f6c23e !important;
        }
        
        .bg-gradient-primary {
            background-color: #4e73df;
            background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
            background-size: cover;
        }
        
        .text-truncate-2 {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1050;
        }
        
        .sidebar-dark .nav-link {
            color: rgba(255, 255, 255, .8);
        }
        
        .sidebar-dark .nav-link:hover {
            color: #fff;
            background-color: rgba(255, 255, 255, .1);
        }
        
        .sidebar-dark .nav-link.active {
            color: #fff;
            background-color: rgba(255, 255, 255, .2);
        }
        
        /* 选择列样式 */
.user-checkbox {
    cursor: pointer;
}

/* 批量操作区域样式 */
#batchActions {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 表格行选中状态 */
.table tbody tr.selected {
    background-color: rgba(0, 123, 255, 0.1);
}

        /* 物流详情样式 */
.tracking-timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #e9ecef;
}

.tracking-item {
    position: relative;
    padding: 10px 0;
    margin-left: 20px;
}

.tracking-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    border: 2px solid white;
}

.tracking-item.latest::before {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.tracking-time {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.tracking-status {
    font-size: 0.9rem;
    color: #495057;
}

/* 导出模态框样式 */
.export-option {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.export-option:hover {
    background-color: #f8f9fa;
}

.export-option input[type="radio"] {
    margin-right: 8px;
}

.export-option label {
    margin-bottom: 0;
    cursor: pointer;
}
    </style>
</head>
<body>
    <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
        <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#">报单系统后台</a>
        <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="w-100"></div>
        <div class="navbar-nav">
            <div class="nav-item text-nowrap">
                <a class="nav-link px-3" href="../logout.php">
                    <i class="bi bi-box-arrow-right"></i> 退出登录
                </a>
            </div>
        </div>
    </header>

    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                <div class="position-sticky pt-3">
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="index.php">
                                <i class="bi bi-speedometer2"></i> 仪表盘
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="users.php">
                                <i class="bi bi-people"></i> 用户管理
                            </a>
                        </li>
                        <li class="nav-item">
                        <a class="nav-link active text-white" href="orders.php">
                            <i class="bi bi-list-check"></i> 全部订单
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white-50" href="pending_orders.php">
                            <i class="bi bi-hourglass-split"></i> 待结账订单
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white-50" href="completed_orders.php">
                            <i class="bi bi-check-circle"></i> 已结账订单
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white-50" href="refunded_orders.php">
                            <i class="bi bi-cash-coin"></i> 已回款订单
                        </a>
                    </li>
                                            <li class="nav-item">
                            <a class="nav-link text-white-50" href="settlements.php">
                                <i class="bi bi-cash-coin"></i> 结算管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="batch_query.php">
                                <i class="bi bi-search"></i> 批量查询
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="batch_settlement.php">
                                <i class="bi bi-cash-coin"></i> 批量结算
                            </a>
                        </li>
                        <!-- 在 header.php 的侧边栏导航中添加 -->
                        <li class="nav-item">
                            <a class="nav-link text-white-50" data-bs-toggle="collapse" href="#toolsMenu" role="button">
                                <i class="bi bi-tools"></i> 小工具
                                <i class="bi bi-chevron-down float-end"></i>
                            </a>
                            <div class="collapse" id="toolsMenu">
                                <ul class="nav flex-column ms-3">
                                    <li class="nav-item">
                                        <a class="nav-link text-white-50" href="express_tool.php">
                                            <i class="bi bi-truck"></i> 快递查询
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="config_options.php">
                                <i class="bi bi-gear"></i> 配置管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="announcements.php">
                                <i class="bi bi-megaphone"></i> 公告管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link text-white-50" href="settings.php">
                                <i class="bi bi-sliders"></i> 系统设置
                            </a>
                        </li>
                        <li class="nav-item mt-3">
                            <a class="nav-link text-white-50" href="../index.php">
                                <i class="bi bi-house"></i> 返回首页
                            </a>
                        </li>
                    </ul>
                </div>
            </nav>

            <!-- 主内容 -->
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
                <!-- 页面内容将在这里插入 -->